package com.oba.base.service;

import javax.faces.context.FacesContext;

import com.oba.king.login.UserInfo;


public class WebBean {
	
	public static String SYSTEM_USER = "systemuser";
	
	private UserInfo sysUser;

	public UserInfo getSysUser() {
		if(sysUser == null) {
			return (UserInfo)getSessionVar(SYSTEM_USER);
		}
		return sysUser;
	}

	public void setSysUserNull() {
		this.sysUser = null;
	}

	private Object getSessionVar(String varName) {
		return FacesContext.getCurrentInstance().getExternalContext()
				.getSessionMap().get(varName);
	}

}
